package com.example.module.widget;

import android.content.Context;
import android.view.Gravity;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;

import com.example.R;

public class Snapshot extends FrameLayout {
	
	public Snapshot(Context context) {
		super(context);
		initialize();
	}
	
	private void initialize() {
		setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT, Gravity.TOP));
	}

	public void animateSpin(Animation.AnimationListener animationListener) {
		Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.spin_left_out);
		animation.setAnimationListener(animationListener);
		startAnimation(animation);
	}
	
	public void animateFade(Animation.AnimationListener animationListener) {
		Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.slide_left);
		animation.setAnimationListener(animationListener);
		startAnimation(animation);
	}
}
